<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Javscript</title>
    <script type="text/javascript">
      window.onload = function(){
        // 获取span标签内容
        // var span = document.getElementsByTagName("span")[0];
        // var span = document.getElementsByClassName('spanclass')[0];
        // var span = document.getElementById("content");
        // alert(span.innerHTML);
        // 修改span内容
        // span.innerHTML = "已经修改了哟~";
      }
      // 定义函数
      function hanshu(canshu){
        alert(canshu);
      }
    </script>
  </head>
  <body>
    <span class="spanclass" id="content">这是span内容</span>
    <span class="spanclass" id="content">这是另外一个内容</span>
    <hr />
    <button onclick="hanshu('这是参数');">函数</button>
  </body>
</html>
